{% extends "admin/common/base.html" %}

{% block content %}
 <!-- Page-Title -->
                        <div class="row">
                            <div class="col-sm-12">
                                <h4 class="pull-left page-title">Editable Table</h4>
                                <ol class="breadcrumb pull-right">
                                    <li><a href="#">Moltran</a></li>
                                    <li><a href="#">Tables</a></li>
                                    <li class="active">Editable Table</li>
                                </ol>
                            </div>
                        </div>


                        <div class="panel">

                            <div class="panel-body">
                                <div class="row">
                                    <div class="col-sm-6">
                                        <div class="m-b-30">
                                            <button id="addToTable" class="btn btn-success waves-effect waves-light">Add <i class="fa fa-plus"></i></button>
                                        </div>
                                    </div>
                                </div>
                                <table class="table table-bordered table-striped" id="datatable-editable">
                                    <thead>
                                        <tr>
                                            <th>博客标题</th>
                                            <th>博客作者</th>
                                            <th>创作时间</th>
                                            <th>评论数量</th>
                                            <th>浏览数量</th>
                                            <th>文章状态</th>
                                            <th>文章类型</th>
                                            <th>博客操作</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    {% for item in page.elements %}
                                        <tr class="gradeX">
                                            <td>{{ item.title }}</td>
                                            <td>{{ item.create_by }}</td>
                                            <td>{{ item.create_at }}</td>
                                            <td>{{ item.comment_count }}</td>
                                            <td>{{ item.view_count }}</td>
                                             <td>{{ item.status }}</td>
                                             <td>{{ item.document_type }}</td>
                                            <td class="actions">
                                                <a href="#" class="hidden on-editing save-row"><i class="fa fa-save"></i></a>
                                                <a href="#" class="hidden on-editing cancel-row"><i class="fa fa-times"></i></a>
                                                <a href="/admin/edit_article/{{item.uuid}}" class="on-default edit-row"><i class="fa fa-pencil">编辑</i></a>
                                                <a href="/admin/article_delete/{{item.uuid}}/{{page.page}}" class="on-default remove-row"><i class="fa fa-trash-o">删除</i></a>
                                                <a href="/admin/article_publish/{{item.uuid}}/{{page.page}}" class="on-default save-row"><i class="ion-checkmark-circled">发布</i></a>
                                                <a href="/admin/article_top/{{item.uuid}}/{{page.page}}" class="on-default save-row"><i class="ion-arrow-up-a">置顶</i></a>
                                            </td>
                                        </tr>
                                    {% endfor %}
                                    </tbody>
                                </table>
                            </div>
                             <div class="pagination">
                                <ul class="pagination">
    {% if page.has_pre %}
      <li class=''><a href='/admin/article_manage/{{ page.page-1 }}'>上一页</a></li>
   {%endif%}

    {% for index in range(page.size) %}
      {%  if page.page + index < page.total_page %}
       <li class="active"><a href="/admin/article_manage/{{ page.page+index }}" rel="external nofollow" rel="external nofollow" >{{ page.page+index }}</a></li>
     {%endif%}
                                    {%endfor%}

    {% if page.has_next %}
      <li class=''><a href='/admin/article_manage/{{ page.page + 1 }}'>下一页</a></li>
    {%endif%}
 </ul>
                    </div>
                        </div>
{% endblock %}